<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>返回image的longdesc属性的值</title>
</head>

<body>
    <img id="compman" src="compman.gif" longdesc="description.htm" alt="Computerman" width="107" height="98">
    <br>
    <p>longdesc属性的值为:
        <script>
            var x = document.getElementById("compman");
            document.write(document.getElementById("compman").longDesc);
        </script>
    </p>
</body>

</html>